package com.example.tijianserver.service;

import com.example.tijianserver.mapper.HospitalMapper;
import com.example.tijianserver.pojo.Hospital;
import com.example.tijianserver.response.ApiRestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HospitalsServiceImpl implements HospitalsService {
    //处理查询医院列表数据的方法，正常营业的医院

    @Autowired
    HospitalMapper hospitalMapper;

    @Override
    public List<Hospital> listHospital(Hospital hospital){

        List<Hospital> list=hospitalMapper.selectList(hospital.getState());
        return list;
    }

    public Hospital getHospitalById(Hospital hospital){
        Hospital hospital1=hospitalMapper.selectByPrimaryKey(hospital.getHpId());
        return hospital1;
    }

}
